package br.com.equus.entidade;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.envers.Audited;

import br.com.arquitetura.entidade.Entidade;

@Entity
@Table(name = "EQ_STATUS_MANEJO", catalog = "EQUUS")
@Audited
public class StatusManejo extends Entidade<Integer> {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID_STATUS_MANEJO", unique = true, nullable = false)
	private Integer id;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_STATUS_EXECUCAO", referencedColumnName = "ID_STATUS_EXECUCAO")
	private StatusExecucao statusExecucao;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_MANEJO_ANIMAL", referencedColumnName = "ID_MANEJO_ANIMAL")
	private ManejoAnimal manejoAnimal;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DT_CADASTRADO", nullable = false)
	private Date dtCadastro;

	@Column(name = "OBS_STATUS_MANEJO", columnDefinition = "text")
	private String motivo;

	public StatusManejo() {
	}

	public StatusManejo(Integer id) {
		this.id = id;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public ManejoAnimal getManejoAnimal() {
		return manejoAnimal;
	}

	public void setManejoAnimal(ManejoAnimal manejoAnimal) {
		this.manejoAnimal = manejoAnimal;
	}

	public Date getDtCadastro() {
		return dtCadastro;
	}

	public void setDtCadastro(Date dtCadastro) {
		this.dtCadastro = dtCadastro;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public StatusExecucao getStatusExecucao() {
		return statusExecucao;
	}

	public void setStatusExecucao(StatusExecucao statusExecucao) {
		this.statusExecucao = statusExecucao;
	}

	public String getMotivo() {
		return motivo;
	}

	public void setMotivo(String motivo) {
		this.motivo = motivo;
	}

}
